package com.tuotu.gps.view;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.widget.TextView;

import com.tuotu.gps.R;

/**
 * Created by XuYeWen on 2018/3/7.
 */

public class CircleTextView extends TextView {

    private Paint paint;
    public CircleTextView(Context context) {
        super(context);
    }

    public CircleTextView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        paint=new Paint();
//        paint.setColor(Color.parseColor("#ff0000"));
        paint.setColor(Color.TRANSPARENT);
    }

    public CircleTextView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        canvas.drawCircle(getWidth()/2,getHeight()/2,getMeasuredWidth()/2,paint);
    }
}
